import 'package:flutter/material.dart';
import 'package:flutter_douban/config/app_colors.dart';
import 'package:flutter_douban/main_page/store/page/store_commit_list_page.dart';
import 'package:flutter_douban/model/store_commit_mode.dart';

import 'commit_cell.dart';

class ProductBigCommitCell extends StatefulWidget {
  final List<StoreCommitModel>? list;
  const ProductBigCommitCell({Key? key, required this.list}) : super(key: key);

  @override
  _ProductBigCommitCellState createState() => _ProductBigCommitCellState();
}

class _ProductBigCommitCellState extends State<ProductBigCommitCell> {
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(left: 20, right: 20,top: 20),
      child: Column(
        children: [
          InkWell(
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                RichText(
                  text: TextSpan(
                    text: '评价晒单 ',
                    style: TextStyle(
                        fontSize: 20,
                        color: AppColors.black,
                        fontWeight: FontWeight.bold),
                    children: [
                      TextSpan(
                        text: '(3)',
                        style: TextStyle(
                            fontSize: 15,
                            color: Colors.black54,
                            fontWeight: FontWeight.w400),
                      ),
                    ],
                  ),
                ),
                Image.asset(
                  'assets/images/common/arrow_white_right@2x.png',
                  width: 20,
                  height: 20,
                  color: Colors.black38,
                )
              ],
            ),
            onTap: (){
              Navigator.of(context).push(MaterialPageRoute(builder: (_) {
                return StoreCommitListPage();
              }));
            },
          ),
          SizedBox(height: 10,),
          ProductDetailCommitCell(model: widget.list![0],),
          ProductDetailCommitCell(model: widget.list![1],)
        ],
      ),
    );
  }
}
